﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
using System.Data.Services.Client;

namespace AzureTest
{
    public class TestDataServiceContext : TableServiceContext
    {
        // Constructor creates a connection to Azure Storage
        public TestDataServiceContext(string baseAddress, StorageCredentials credentials)
            : base(baseAddress, credentials)
        {
        }

        public const string DataTableName = "DataTable";
        
        // this is your Azure Table representation
        public IQueryable<TestDataModel> DataTable
        {
            get
            {
                return this.CreateQuery<TestDataModel>(DataTableName);
            }
        }
    }
}